﻿namespace WatiNSahi.Extensions
{
    using global::WatiN.Core;

    public static class FrameCollectionExtensions
    {
        public static bool Exists(this FrameCollection frameCollection, string frameIdOrNameOrValueorClass, bool extension = true)
        {
            return frameCollection.Exists(Find.ById(frameIdOrNameOrValueorClass)) ||
                frameCollection.Exists(Find.ByName(frameIdOrNameOrValueorClass)) ||
                frameCollection.Exists(Find.ByValue(frameIdOrNameOrValueorClass)) ||
                frameCollection.Exists(Find.ByClass(frameIdOrNameOrValueorClass)) ||
                frameCollection.Exists(Find.ByLabelText(frameIdOrNameOrValueorClass));
        }
    }
}